// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import App from './App'
import router from './router'
import ElementUI from 'element-ui'
import VueResource from 'vue-resource'
import store from './store/index'
import 'element-ui/lib/theme-chalk/index.css'
import  VueQuillEditor from 'vue-quill-editor'
// require styles 引入样式
import 'quill/dist/quill.core.css'
import 'quill/dist/quill.snow.css'
import 'quill/dist/quill.bubble.css'
import echarts from 'echarts'

Vue.use(VueQuillEditor)
Vue.use(ElementUI)
Vue.use(VueResource)
Vue.prototype.$echarts = echarts

/*公用接口地址*/
Vue.prototype.conURL = '/api/';
// Vue.prototype.conURL = '/';


Vue.prototype.conImgURL = 'http://120.26.113.44:7080/mongofileserver/api/file/';

Vue.http.headers.common['Content-Type'] = 'application/json;charset=UTF-8';
Vue.http.headers.common['Accept'] = '*/*';

Vue.http.interceptors.push((request, next) => {
  store.state.public_backShow = true
  Vue.http.headers.common.Authorization = "Bearer " + localStorage.getItem('token');
  next((response) => {
    store.state.public_backShow = false
    if (response.status == 200 && response.ok) {
      return response;
    }else {

    }
  })
});

/* eslint-disable no-new */
new Vue({
  el: '#app',
  router,
  store,//使用store
  components: { App },
  template: '<App/>',
})
